import { createMemoryHistory, createRouter, createWebHashHistory,createWebHistory } from 'vue-router'
import Find from '../views/Find.vue'
//创建路由的规则数组
const routes = [
    {
        path: '/',
        name: 'home',
        component: ()=> import('../views/Home.vue')
    },
    {
        path: '/find',
        name: 'find',
        component: Find,
        //二级路由 也叫嵌套路由
        children: [
            {
                path: 'discover',
                component:()=>import('../views/Second/Discover.vue')
            },
            {
                path: 'toplist',
                component:()=>import('../views/Second/Toplist.vue')
            },
            {
                path: 'playlist',
                component:()=>import('../views/Second/Playlist.vue')
            },
            {
                path: 'djradio',
                component:()=>import('../views/Second/Djradio.vue')
            }
        ]
    },
    {
        path: '/my',
        name: 'my',
        component: ()=> import('../views/My.vue')
        
    },
    {
        path: '/friend',
        name: 'friend',
        component: () => import('../views/Friend.vue')

    }
    ,
    {
        path: '/musician',
        name: 'musician',
        component: () => import('../views/Musician.vue')

    }
]

const router = createRouter({
    // history: createWebHashHistory(),
    history: createWebHistory(),
    routes
})
//默认导出 谁用 谁引入
export default router
